<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<c:set var="ctxPath" value="${pageContext.request.contextPath}" />
<script type="text/javascript">
    $(function() {
        $(document).ready(function() {
  
            $.ajax({
                type : "POST",
                url : "homeController.do?getBroswerBar&reportType=${reportType}",
                success : function(jsondata) {
                   
                    data = eval(jsondata);
           
                    var xAxisCategories = new Array();
                    var j=0;
                    for(var i = data[0].data.length-1; i>=0; i--){
                        xAxisCategories[j] = data[0].data[i].name;
                        j++;
                    }
                    var data1 = new Array();
                    var k=0;
                    for(var i = data[0].data.length-1; i >=0; i--){
                    	data1[k] = data[0].data[i].y;  
                    	k++;
                    	
                    } 

                var   chart = new Highcharts.Chart({
                        chart : {
                            renderTo : 'containerline',
                            plotBackgroundColor : null,
                            plotBorderWidth : null,
                            plotShadow : false
                        },
                       
                        title : {
                            text : "<t:mutiLang langKey="数据传输"/>"
                        },
                        xAxis : {
                            categories : xAxisCategories
                        },
                        yAxis: {  
  //                          max:1000, // 定义Y轴 最大值  
                            min:0, // 定义最小值  
                          
                            title: {  
                                text: '上传数量'  
                            }
                        },  
                        tooltip : {
                            pointFormat : '{series.name}: <b>{point.y}</b>',
                            percentageDecimals : 1

                        },
                        exporting:{
                            filename:'折线图',
                            url:'${ctxPath}/logController.do?export'
                        },
                        plotOptions : {
                            pie : {
                                allowPointSelect : true,
                                cursor : 'pointer',
                                showInLegend : true,
                                dataLabels : {
                                    enabled : true,
                                    color : '#000000',
                                    connectorColor : '#000000',
                                    formatter : function() {
                                        return '<b>' + this.point.name + '</b>: ' + this.y;
                                    }
                                }
                            }
                        },
                      
                        series : [
                        	{
                        		data:JSON.parse("["+data1+"]")
   	
                        }]                        	                       	
                    });
                }
            });
        });
    });
</script>
<div id="containerline" style="width: 80%; height: 80%"></div>


